package cn.zhibang.sannuo.web.controller;

import cn.zhibang.sannuo.commons.model.Accountnumber;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author AdminController
 * @version 1.0.0
 * @ClassName MyCenterController.java
 * @Description TODO 个人中心
 * @createTime 2021年03月29日 19:03:00
 */
@Controller
@RequestMapping("/mycenter")
public class MyCenterController {

    @GetMapping("/personal")//个人信息
    public String personal(Model model){
        Subject subject = SecurityUtils.getSubject();
        Accountnumber accountnumber = (Accountnumber)subject.getPrincipal();
        model.addAttribute("accountnumber", accountnumber);
        return "html/personal";
    }

    @GetMapping("/change_password")//修改密码
    public String change_password(){
        return "html/change_password";
    }

}
